#include <stdio.h>
#include <stdlib.h>

int main()
{
    int x,a,b,c;
    scanf("%d",&x);
    a=x%10;
    x=x/10;
    b=x%10;
    x=x/10;
    c=x%10;
    printf("%d",a+b+c);
    return 0;
}
